To be able to edit code and run cells, you need to run the notebook yourself. Where would you like to run the notebook?

This notebook takes about 40 seconds to run.

In the cloud (experimental)

Binder is a free, open source service that runs scientific notebooks in the cloud! It will take a while, usually 2-7 minutes to get a session.

On your computer

(Recommended if you want to store your changes.)

  1. Copy the notebook URL:
  2. Run Pluto

    (Also see: How to install Julia and Pluto)

  3. Paste URL in the Open box

Frontmatter

If you are publishing this notebook on the web, you can set the parameters below to provide HTML metadata. This is useful for search engines and social media.

Author 1

4월14일

👀 Reading hidden code
md"""
# 4월14일
"""
172 μs
👀 Reading hidden code
html"""
<div style="display: flex; justify-content: center;">
<div notthestyle="position: relative; right: 0; top: 0; z-index: 300;">
<iframe src=
"
https://www.youtube.com/embed/playlist?list=PLQqh36zP38-yjMoBmAl_xzxd8GipR_Ze_
"
width=600 height=375 frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
"""
127 μs

Usings

👀 Reading hidden code
171 μs
using PlutoUI, Plots,Distributions
👀 Reading hidden code
5.7 s
PlutoUI.TableOfContents()
👀 Reading hidden code
4.5 ms
Plots.plotly()
👀 Reading hidden code
For saving to png with the Plotly backend PlotlyBase has to be installed.
423 ms

정규분포

👀 Reading hidden code
192 μs

위치모수와 척도모수

👀 Reading hidden code
166 μs

- 정규분포 특징

  • 이론: $Z\sim N(0,1) \Rightarrow aZ+b \sim N(b,a^2)$

  • 생각보다 이거 엄청 신기한 기능이에요

  • 정규분포에 어떠한 상수를 더해도 정규분포, 어떠한 상수를 곱해도 정규분포, 더하고 곱해도 정규분포!

👀 Reading hidden code
429 μs

- 위치모수, 척도모수

  1. 확률변수 $Z$가 분포A를 따를때 $Z+b$도 분포A를 따름 $\Rightarrow$ 분포A는 위치모수를 가짐

  2. 확률변수 $Z$가 분포B를 따를때 $aZ$도 분포B를 따름 $\Rightarrow$ 분포A는 척도모수를 가짐

  3. 확률변수 $Z$가 분포C를 따를때 $aZ+b$도 분포C를 따름 $\Rightarrow$ 분포A는 위치모수와 척도모수를 가짐

👀 Reading hidden code
460 μs

- 예시:

  • 분포C: {정규분포, 균등분포, 로지스틱, 이중지수, 코쉬}

  • 분포A: 분포C랑 동일

  • 분포B: 분포C ∪ {지수분포,감마분포}

  • 분포C - 분포A: 없다고 생각하세요..

  • 분포C - 분포B: {지수분포, 감마분포}

👀 Reading hidden code
516 μs

- 저런걸 어떻게 알아요? 특정분포가 위치모수를 가지는지 척도모수를 가지는지 어떻게 따져요?

  • 이론: $Z$의 pdf가 $f_Z(x)$ $\Rightarrow$ $aZ+b$의 pdf는 $f_{aZ+b}(x)=\frac{1}{a}f_Z(\frac{x-b}{a})$

  • 증명: 스스로 공부 + 최혜미교수님한테 여쭤보세요.. + 저한테 카톡으로 // 외우는게 편해요

  • 결국 $f_Z(x)$가 분포C의 가능한 pdf중 하나의 형태일때 $\frac{1}{a}f_Z(\frac{x-b}{a})$ 역시 분포C의 가능한 pdf 중 하나의 형태라면 분포C는 위치모수와 척도모수를 가진다.

  • $f_Z(x)$가 분포A의 가능한 pdf중 하나의 형태일때 $f_Z(x-b)$ 역시 분포A의 가능한 pdf 중 하나의 형태라면 분포A는 위치모수를 가진다.

  • $f_Z(x)$가 분포B의 가능한 pdf중 하나의 형태일때 $\frac{1}{a}f_Z(\frac{x}{a})$ 역시 분포B의 가능한 pdf 중 하나의 형태라면 분포B는 척도모수를 가진다.

👀 Reading hidden code
609 μs

(예제1) $Z \sim Exp(1)$ 이면 $f_Z(x)=e^{-x}$ 이다. 이론에 따라서

$$f_{6Z}(x)=\frac{1}{6}f_Z\big(\frac{x}{6}\big)=\frac{1}{6}e^{-\frac{x}{6}}$$

이다. 그런데 이것은 평균이 6인 지수분포의 pdf와 모양이 같다. 일반화하면

$$Z \sim Exp(\lambda) \Rightarrow aZ \sim Exp(\lambda/a)$$

라고 볼 수 있다. 즉 지수분포를 따르는 화률변수에 임의의 상수값을 곱해도 여전히 지수분포를 따르므로 지수분포는 척도모수를 가진다고 볼 수 있다.

👀 Reading hidden code
322 μs

(예제2) $Z \sim N(0,\sigma^2)$ 이면 $f_Z(x)=\frac{1}{\sqrt{2\pi}\sigma}e^{-\frac{1}{2}(\frac{x}{\sigma})^2}$ 이다. 이론에 따라서

$$f_{Z+3}(x)=f_Z(x-3)=\frac{1}{\sqrt{2\pi}}e^{-\frac{1}{2}(\frac{x-3}{\sigma})^2}$$

이다. 그런데 이것은 평균이 3이고 분산이 $\sigma^2$인 정규분포의 pdf와 모양이 같다. 일반화하면

$$Z \sim N(0,\sigma^2) \Rightarrow Z+b \sim N(b,\sigma^2)$$

라고 볼 수 있다. 즉 정규분포를 따르는 화률변수에 임의의 상수값을 더해도 여전히 정규분포를 따르므로 정규분포는 위치모수를 가진다고 볼 수 있다.

👀 Reading hidden code
308 μs

(예제3) $Z \sim Exp(1)$ 이면 $f_Z(x)=e^{-x}$ 이다. 이론에 따라서

$$f_{Z-1}(x)=f_Z\big(x+1\big)=e^{-(x+1)}$$

이다. 그런데 이것은 지수분포의 pdf중 한 형태라고 볼 수 없다. 즉 지수분포에서 어떠한 상수를 더한것이 지수분포라고 볼 수 없다. 지수분포는 위치모수를 가지지 않는다.

👀 Reading hidden code
246 μs

- 시뮬레이션 확인1 (정규분포)

👀 Reading hidden code
180 μs
let
a=2
b=3
N=100000
( rand(Normal(0,1),N) .|> x-> a*x+b ) |> histogram
rand(Normal(b,a),N) |> histogram!

end
👀 Reading hidden code
4.4 s

- 시뮬레이션확인2 (지수분포)

👀 Reading hidden code
179 μs
let
N = 100000

rand(Exponential(12),N) |> histogram
rand(Exponential(1),N).*12 |> histogram!
rand(Exponential(2),N).*6 |> histogram!
rand(Exponential(3),N).*4 |> histogram!
rand(Exponential(4),N).*3 |> histogram!
rand(Exponential(6),N).*2 |> histogram!

end
👀 Reading hidden code
118 ms

평균과 분산의 추정

👀 Reading hidden code
175 μs
  • 평균: 0.5

  • 평균의 추정치: 0.4956493470915791

  • 분산: 2.25

  • 분산의 추정치: 2.258331007297548

let
N=100000
μ=0.5
σ=1.5
X=rand(Normal(μ,σ),N)
md"""
- 평균: $μ
- 평균의 추정치: $(mean(X))
- 분산: $(σ^2)
- 분산의 추정치: $(var(X))
"""
end
👀 Reading hidden code
135 ms
Loading more cells...